import { Map } from 'immutable'
import *as actionTypes from './constants'
const defaultState = Map({
    visible: false,
    phoneVisible: false,
    liginSucceedInfo: {},
    isShowRegister:false
})
function reducer(state = defaultState, action) {
    switch (action.type) {
        case actionTypes.CHNAGE_SHOW_MODAL:
            return state.set("visible", action.visible)
        case actionTypes.CHNAGE_PHONE_LOGIN:
            return state.set("phoneVisible", action.phoneVisible)
        case actionTypes.CHNAGE_LOGIN_SUCCEED_INFO:
            return state.set("liginSucceedInfo", action.liginSucceedInfo)
        case actionTypes.CHNAGE_EXIT:
            return state.set("liginSucceedInfo", action.liginSucceedInfo)
        case actionTypes.CHNAGE_REGISTER:
            return state.set("isShowRegister", action.isShowRegister)
        default:
            return state
    }
}
export default reducer